Package-level declarations

Contains all classes/methods for the Mood Analytics feature

Types

Link copied to clipboard
data class BiWeeklyAnalyticsUIState(val pastEvaluations: List<BiWeeklyEvaluationEntry>? = null, val graphData: List<LineData>? = null)

Represents the UI state for BiWeekly mood analytics. This includes past BiWeekly evaluations and corresponding graph data.

Link copied to clipboard
class BiWeeklyAnalyticsViewModel @Inject constructor(biWeeklyMoodRepository: BiWeeklyMoodRepository) : ViewModel

ViewModel responsible for managing BiWeekly mood analytics. It fetches BiWeekly mood data, processes it, and provides it to the UI.

Link copied to clipboard
data class DailyAnalyticsUIState(val pastEvaluations: List<DailyEvaluationEntry> = listOf(), val selectedDate: LocalDate? = null)

Represents the UI state for daily mood analytics. This includes historical evaluations and the currently selected date.

Link copied to clipboard
data class DailyAnalyticsViewModel @Inject constructor(dailyMoodRepository: DailyMoodRepository) : ViewModel

ViewModel responsible for managing daily mood analytics. It handles data retrieval, state management, and user interactions.

Link copied to clipboard
data class MoodCalendarUIState(val foo: String)

Represents the UI state for the mood calendar, used for displaying mood-related data.

Functions

Link copied to clipboard
fun AnalyticsScreen(modifier: Modifier = Modifier, id: Int = 0, openDrawer: () -> Unit, onNavigateToSummaryDialog: (BiWeeklyEvaluationEntry?) -> Unit)

Displays the main Analytics screen, which includes navigation and a top bar.

Link copied to clipboard
fun AnalyticsScreenContent(modifier: Modifier = Modifier, id: Int = 0, onNavigateToSummaryDialog: (BiWeeklyEvaluationEntry?) -> Unit)

Displays the content of the Analytics screen, including a tabbed interface for Quick and BiWeekly tabs.

Link copied to clipboard
fun AppHorizontalCalendar(modifier: Modifier = Modifier, evaluations: List<DailyEvaluationEntry>, selectedDate: LocalDate? = null, onDateSelect: (LocalDate?) -> Unit)

Displays a horizontal calendar with daily evaluations. Each date can be selected, and associated mood colors are displayed based on the evaluations. Allows navigation through months and displays mood-based color indicators.

Link copied to clipboard
fun BiWeeklyAnalyticsScreenContent(modifier: Modifier = Modifier, viewModel: BiWeeklyAnalyticsViewModel = hiltViewModel(), onNavigateToSummaryDialog: (BiWeeklyEvaluationEntry?) -> Unit)

A composable function that displays the Bi-Weekly Analytics screen. It uses TabbedContent to present different sections such as the mood graph and evaluation history. The content is dynamically updated based on the data from the ViewModel.

Link copied to clipboard
fun BiWeeklyHistoricalAnalytics(biWeeklyEvaluations: List<BiWeeklyEvaluationEntry>, onNavigateToSummaryDialog: (BiWeeklyEvaluationEntry?) -> Unit)

A composable function that displays a list of bi-weekly evaluations, categorized by the current week, last week, and previous weeks. It also computes the severity for depression and anxiety scores and displays them accordingly.

Link copied to clipboard

Displays a card with daily evaluation details such as the strongest emotion and stress level.

Link copied to clipboard
fun DailyAnalyticsScreenContent(modifier: Modifier = Modifier, viewModel: DailyAnalyticsViewModel = hiltViewModel())

Displays the content for the daily analytics screen. This includes a calendar of daily evaluations and historical analytics.

Link copied to clipboard
fun DailyEvaluationCalendar(modifier: Modifier = Modifier, evaluations: List<DailyEvaluationEntry>, selectedDate: LocalDate?, onDateSelect: (LocalDate?) -> Unit)

Displays a calendar for daily evaluations and allows the user to select a date.

Link copied to clipboard

Displays a historical analytics view of the user's daily evaluations. The evaluations are grouped by today, yesterday, and previous days.

Link copied to clipboard
fun Day(day: CalendarDay, isSelected: Boolean, moodColor: Color = Color.Transparent, onClick: (Date?) -> Unit)

Displays a single day in the calendar, showing the date and mood color based on the evaluation.

Link copied to clipboard
fun DepressionGraph(data: List<LineData>)

A composable function that renders a line graph for either depression or anxiety scores over time.

Link copied to clipboard

Helper function to generate mock bi-weekly evaluation entries with sequential scores.

Link copied to clipboard
fun MonthHeader(month: YearMonth, daysOfWeek: List<DayOfWeek>, animateScrollToMonth: suspend (YearMonth) -> Unit)

Displays a header for the month containing navigation buttons and the name of the current month.

Link copied to clipboard

A composable function that displays the mood graph screen for bi-weekly evaluations. It generates line charts showing depression and anxiety scores over time, grouped by evaluation entries.

Link copied to clipboard
fun stressLevel(currentStress: String): String

Maps the stress level description to a general stress level.

Link copied to clipboard
fun SummaryCard(result: BiWeeklyEvaluationEntry, onNavigateToSummaryDialog: (BiWeeklyEvaluationEntry?) -> Unit)

Displays a card with the details of a bi-weekly evaluation entry, including depression and anxiety scores.

Link copied to clipboard

Displays a popup showing detailed information about a bi-weekly evaluation entry, including depression and anxiety scores.

Link copied to clipboard
fun TabbedContent(modifier: Modifier = Modifier, key: String = "", labelToContent: Map<String, @Composable () -> Unit>, wrapperComposable: @Composable () -> Unit? = null)

A composable that displays tabbed content where the active tab's content is displayed below the tab options.

Link copied to clipboard

Extension function to convert a LocalDate to a Date. This function converts the LocalDate to a Date by first setting it to the start of the day, then converting it to an Instant and finally to a Date object.

Link copied to clipboard

Extension function to convert a Date object to a LocalDate. This function converts the date's epoch time to an Instant, then uses the system's default time zone to convert it to a LocalDate.

Link copied to clipboard

Displays a title for a given week category in the analytics view.